<script setup>
import { ref } from 'vue';
import { RouterLink } from 'vue-router';
import SoundControl from './SoundControl.vue';
</script>

<template>
  <header class="game-header">
    <div class="header-content">
      <div class="logo-container">
        <div class="logo-placeholder">
          <span class="logo-text">NRT</span>
        </div>
      </div>
      <h1 class="game-title">火影忍者 - 忍者对战</h1>
      <div class="nav-links">
        <router-link to="/" class="nav-link">首页</router-link>
        <router-link to="/about" class="nav-link">关于</router-link>
        <router-link to="/user-center" class="nav-link">个人中心</router-link>
        <router-link to="/vip-center" class="nav-link">会员中心</router-link>
        <router-link to="/ai-qa" class="nav-link">AI问答</router-link>
        <SoundControl />
      </div>
    </div>
  </header>
</template>

<style scoped>
:root {
  --naruto-red: #9b0000;
  --naruto-orange: #ff6600;
  --naruto-black: #000000;
}

.game-header {
  background: linear-gradient(135deg, var(--naruto-red) 0%, var(--naruto-orange) 100%);
  color: white;
  padding: 1.5rem 0;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  border-bottom: 4px solid var(--naruto-black);
}

/* 装饰元素 */
.game-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* 忍者标志背景图案 */
.game-header::after {
  content: '忍';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-20deg);
  font-size: 15rem;
  font-weight: bold;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.logo-container {
  width: 80px;
  height: 80px;
}

.logo-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #ff9900, #ff6600);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  font-weight: bold;
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.logo-placeholder:hover {
  transform: rotate(10deg) scale(1.1);
}

.game-title {
  margin: 0;
  font-size: 2.2rem;
  text-align: center;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
  position: relative;
  animation: titleFloat 4s ease-in-out infinite;
  letter-spacing: 1px;
}

@keyframes titleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.game-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: rgba(255, 255, 255, 0.7);
  margin: 10px auto 0;
  border-radius: 3px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: white;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  font-weight: bold;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.nav-link:hover::before {
  left: 100%;
}

.nav-link.router-link-active {
  background-color: rgba(255, 153, 0, 0.7);
  font-weight: bold;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .game-header::after {
    font-size: 10rem;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1.2rem;
  }
  
  .logo-container {
    width: 70px;
    height: 70px;
  }
  
  .logo-placeholder {
    font-size: 1.8rem;
  }
  
  .game-title {
    font-size: 1.8rem;
  }
  
  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .nav-link {
    padding: 0.8rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .game-header::after {
    font-size: 8rem;
  }
  
  .logo-container {
    width: 60px;
    height: 60px;
  }
  
  .logo-placeholder {
    font-size: 1.5rem;
  }
  
  .game-title {
    font-size: 1.6rem;
  }
}
</style>